package edu.gdkm.dao;

import edu.gdkm.pojo.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface StudentXml {
    //新增一个学生
    @Insert("insert into tb_stu(name,gender,birthday,mobile) values(#{name},#{gender},#{birthday},#{mobile})")
    public boolean save(Student student);
    //修改学生信息
    @Update("update tb_stu set name=#{name},gender=#{gender},birthday=#{birthday},mobile=#{mobile} where id=#{id}")
    public boolean update(Student student);
    //删除一个学生
    @Delete("delete from tb_stu where id=#{id}")
    public boolean delete(Integer id);
    //查询一个学生
    @Select("select * from tb_stu where id=#{id}")
    public Student findById(Integer id);
    //查询所有学生
    @Select("select * from tb_stu")
    public List<Student> findAll();

}
